<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\admin\controller;

class Wx extends \app\ApiRest
{
    public function __construct(\think\App $app)
    {
        parent::__construct($app);
    }
    public function getTabbar()
    {
        $tabbars = longbingGetAppTabbar($this->_uniacid);
        $tabbars = longbingGetWxAppTabbarResponse($tabbars);
        $pluginAuth = longbingGetPluginAuth($this->_uniacid);
        $plugin_map = ["activity" => "activity", "appointment" => "appoint", "house" => "house"];
        $meta_map = ["card" => "BusinessCard", "shop" => "Malls", "dynamic" => "Dynamic", "website" => "Website"];
        foreach ($tabbars["data"] as $k => $item) {
            if(in_array($k, array_keys($plugin_map)) && $pluginAuth["plugin"][$plugin_map[$k]] == 0) {
                unset($tabbars["data"][$k]);
            } elseif(in_array($k, array_keys($meta_map)) && $pluginAuth["web_manage_meta_config"][$meta_map[$k]] == 0) {
                unset($tabbars["data"][$k]);
            }
        }
        return $this->success($tabbars);
    }
}

